function [growth sd] = ag_growth(id,year,X)

[h1,h2,ii]=unique(id);
[h1,h2,jj]=unique(year);

N=max(ii);
T=max(jj);

bigX=zeros(N,T);
bigX(sub2ind([N T],ii,jj))=X;

growth = sum(bigX,1);
sd = std(growth);